The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems identified with an approach should not be assumed to have been recognized in the prior art, unless otherwise indicated.
When a database server receives a statement representing a request to perform a database operation, the database server may generate an execution plan. An execution plan defines the steps and operations performed by a database server to carry out a request. The statement used to request database operations may be in the form of a database command that conforms to a database language, such as Structured Query Language (SQL).
It is desirable to return results sets of queries quickly. As more and more people use databases to get information they are looking for, there is increased likelihood that some of the queries issued against a database are the same. In some systems, results sets of at least certain queries are stored. When a query is received a text based search is performed to find the previously executed query. If it is found that the same identical query (having the same text) is being presented for a second time, and if the results set for that query was stored, the system returns the cached results set rather than performing the query a second time. The more people that use the database, the greater the performance enhancement gained by saving the results sets of queries.
However, many queries are not identical, but similar. Many queries may process subsets of identical data within their results sets. Nonetheless, because the queries are not identical, a cached results set that is likely to have identical subsets of data as the expected results set cannot be reused, despite the similarity of the results sets, and each of the similar queries are executed.
Based on the forgoing, there is still a need to store and reuse results sets of queries.